package spe.ui.editor.command;

import org.eclipse.draw2d.geometry.Point;
import org.eclipse.gef.commands.Command;

import spe.model.spem.NodeElement;

public class ElementChangeLayoutCommand extends Command 
{
	private Point pos;
	private Point oldPos;
	private NodeElement node;
	
	public void setPosition(Point p)
	{
		pos = p;
	}
	
	public void setElement(NodeElement n)
	{
		this.node = n;
	}
	
	@Override
	public void execute()
	{
		oldPos = node.getPosition();
		node.setPosition(pos);
	}
	
	public void undo()
	{
		node.setPosition(oldPos);
	}

}
